// This file contains material supporting section 6.13 of the textbook:
// "Object Oriented Software Engineering" and is issued under the open-source
// license found at www.lloseng.com 

package clientPackage;

import gui.AcademicFrame;

import java.util.*;
import java.io.*;
import java.net.*;

import ocsf.client.AbstractClient;

/**
 * This class acts as a subclass of <code>AbstractClient</code>
 * and is also an <code>Observable</code> class.
 * Each time a new message is received, observers are notified.
 *
 * @author Dr Robert Lagani&egrave;re
 * @author Dr Timothy C. Lethbridge
 * @author Fran&ccedil;ois B&eacute;lange
 * @version Febuary 2001
 */


public class ObservableClient extends AbstractClient
{
	
	private AcademicFrame aFrame;
  public ObservableClient(String host, int port, AcademicFrame frame) {
		super(host, port);
		this.aFrame = frame;
		try {
			openConnection();
		} catch (IOException e) {
			// TODO Auto-generated catch block
		//	e.printStackTrace();
		}
		
		// TODO Auto-generated constructor stub
	}

// Class variables ***************************************************
  

  /**
   * This method is used to handle messages from the server.  This method
   * can be overriden but should always call notifyObservers().
   *
   * @param message The message received from the client.
   */
  protected void handleMessageFromServer(Object message)
  {
	  aFrame.display(message);

  }

  //sendToServer(Object message)
  
}
